<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<script>
    // axios({
    //     method:"get",
    //     url:"http://localhost:8080/axiosServlet?username=zhangsan"
    // }).then(function (resp){
    //     alert(resp.data);
    // })

    // axios({
    //     method:"post",
    //     url:"http://localhost:8080/axiosServlet",
    //     data:"username=zhangsan"
    // }).then(function (resp){
    //     alert(resp.data);
    // })

    axios.get("http://localhost:8080/axiosServlet?username=zhangsan").then(function (resp){
        alert(resp.data);
    })
    axios.get("http://localhost:8080/axiosServlet","username=zhangsan").then(function (resp){
        alert(resp.data);
    })
</script>
</body>
</html>